# export _dsp_start for link script
.global _dsp_start

# declare symbol main for C function main()
.extern main

.section .text.interrupt.vector
jmp exception_nc||
movigl GR28 0xBF00||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF01||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF02||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF03||
nop||
nop||

jmp pic_group_nc||
movigl GR28 0xBF04||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF05||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF6||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF07||
nop||
nop||

jmp exception_nc||
movigl GR28 0xBF08||
nop||
nop||

jmp pic_group_nc||
movigl GR28 0xBF09||
nop||
nop||

#0 10
nop||
nop||
nop||
nop||

#0 11
nop||
nop||
nop||
nop||

#0 12
nop||
nop||
nop||
nop||

#0 13
nop||
nop||
nop||
nop||

#0 14
nop||
nop||
nop||
nop||

#0 15
nop||
nop||
nop||
nop||

#1 0
jmp rt_thread_soft_intr_handler||
nop||
nop||
nop||

#1 1
jmp adca1_isr||
nop||
nop||
nop||

#1 2
jmp adcb1_isr||
nop||
nop||
nop||

#1 3
jmp adcc1_isr||
nop||
nop||
nop||

#1 4
jmp xint1_isr||
nop||
nop||
nop||

#1 5
jmp xint2_isr||
nop||
nop||
nop||

#1 6
jmp timer0_isr||
nop||
nop||
nop||

#1 7
jmp wack_isr||
nop||
nop||
nop||

#1 8
jmp i2ca_high_isr||
nop||
nop||
nop||

#1 9
jmp sys_err_isr||
nop||
nop||
nop||

#1 10
jmp ecat_sync0_isr||
nop||
nop||
nop||

#1 11
jmp ecat_isr||
nop||
nop||
nop||

#1 12
jmp cipc0_isr||
nop||
nop||
nop||

#1 13
jmp cipc1_isr||
nop||
nop||
nop||

#1 14
jmp cipc2_isr||
nop||
nop||
nop||

#1 15
jmp cipc3_isr||
nop||
nop||
nop||

#2 0
jmp epwm1_tz_isr||
nop||
nop||
nop||

#2 1
jmp epwm2_tz_isr||
nop||
nop||
nop||

#2 2
jmp epwm3_tz_isr||
nop||
nop||
nop||

#2 3
jmp epwm4_tz_isr||
nop||
nop||
nop||

#2 4
jmp epwm5_tz_isr||
nop||
nop||
nop||

#2 5
jmp epwm6_tz_isr||
nop||
nop||
nop||

#2 6
jmp epwm7_tz_isr||
nop||
nop||
nop||

#2 7
jmp epwm8_tz_isr||
nop||
nop||
nop||

#2 8
jmp epwm9_tz_isr||
nop||
nop||
nop||

#2 9
jmp epwm10_tz_isr||
nop||
nop||
nop||

#2 10
jmp epwm11_tz_isr||
nop||
nop||
nop||

#2 11
jmp epwm12_tz_isr||
nop||
nop||
nop||

#2 12
jmp epwm13_tz_isr||
nop||
nop||
nop||

#2 13
jmp epwm14_tz_isr||
nop||
nop||
nop||

#2 14
jmp epwm15_tz_isr||
nop||
nop||
nop||

#2 15
jmp epwm16_tz_isr||
nop||
nop||
nop||

#3 0
jmp epwm1_isr||
nop||
nop||
nop||

#3 1
jmp epwm2_isr||
nop||
nop||
nop||

#3 2
jmp epwm3_isr||
nop||
nop||
nop||

#3 3
jmp epwm4_isr||
nop||
nop||
nop||

#3 4
jmp epwm5_isr||
nop||
nop||
nop||

#3 5
jmp epwm6_isr||
nop||
nop||
nop||

#3 6
jmp epwm7_isr||
nop||
nop||
nop||

#3 7
jmp epwm8_isr||
nop||
nop||
nop||

#3 8
jmp epwm9_isr||
nop||
nop||
nop||

#3 9
jmp epwm10_isr||
nop||
nop||
nop||

#3 10
jmp epwm11_isr||
nop||
nop||
nop||

#3 11
jmp epwm12_isr||
nop||
nop||
nop||

#3 12
jmp epwm13_isr||
nop||
nop||
nop||

#3 13
jmp epwm14_isr||
nop||
nop||
nop||

#3 14
jmp epwm15_isr||
nop||
nop||
nop||

#3 15
jmp epwm16_isr||
nop||
nop||
nop||

#nc 0 reset
_dsp_start:
jmp _dsp_call_main||
nop||
nop||
nop||

#nc 1
nop||
nop||
nop||
nop||

#nc 2
nop||
nop||
nop||
nop||

#nc 3
nop||
nop||
nop||
nop||

#nc 4
nop||
nop||
nop||
nop||

#nc 5
nop||
nop||
nop||
nop||

#nc 6
nop||
nop||
nop||
nop||

#nc 7
nop||
nop||
nop||
nop||

#nc 8
nop||
nop||
nop||
nop||

#nc 9
nop||
nop||
nop||
nop||

#nc 10
nop||
nop||
nop||
nop||

#nc 11
nop||
nop||
nop||
nop||

#nc 12
nop||
nop||
nop||
nop||

#nc 13
nop||
nop||
nop||
nop||

#nc 14
nop||
nop||
nop||
nop||

#nc 15
nop||
nop||
nop||
nop||

#4 0
jmp ecap1_isr||
nop||
nop||
nop||

#4 1
jmp ecap2_isr||
nop||
nop||
nop||

#4 2
jmp ecap3_isr||
nop||
nop||
nop||

#4 3
jmp ecap4_isr||
nop||
nop||
nop||

#4 4
jmp ecap5_isr||
nop||
nop||
nop||

#4 5
jmp ecap6_isr||
nop||
nop||
nop||

#4 6
jmp ecap7_isr||
nop||
nop||
nop||

#4 7
jmp adcd1_isr||
nop||
nop||
nop||

#4 8
jmp fsitxa_int1_isr||
nop||
nop||
nop||

#4 9
jmp fsitxa_int2_isr||
nop||
nop||
nop||

#4 10
jmp fsitxb_int1_isr||
nop||
nop||
nop||

#4 11
jmp fsitxb_int2_isr||
nop||
nop||
nop||

#4 12
jmp fsirxa_int1_isr||
nop||
nop||
nop||

#4 13
jmp fsirxa_int2_isr||
nop||
nop||
nop||

#4 14
jmp fsirxb_int1_isr||
nop||
nop||
nop||

#4 15
jmp fsirxb_int2_isr||
nop||
nop||
nop||

#5 0
jmp eqep1_isr||
nop||
nop||
nop||

#5 1
jmp eqep2_isr||
nop||
nop||
nop||

#5 2
jmp eqep3_isr||
nop||
nop||
nop||

#5 3
jmp eqep4_isr||
nop||
nop||
nop||

#5 4
jmp clb1_isr||
nop||
nop||
nop||

#5 5
jmp clb2_isr||
nop||
nop||
nop||

#5 6
jmp clb3_isr||
nop||
nop||
nop||

#5 7
jmp clb4_isr||
nop||
nop||
nop||

#5 8
jmp sdfm1_isr||
nop||
nop||
nop||

#5 9
jmp sdfm2_isr||
nop||
nop||
nop||

#5 10
nop||
nop||
nop||
nop||

#5 11
nop||
nop||
nop||
nop||

#5 12
jmp sdfm1dr1_isr||
nop||
nop||
nop||

#5 13
jmp sdfm1dr2_isr||
nop||
nop||
nop||

#5 14
jmp sdfm1dr3_isr||
nop||
nop||
nop||

#5 15
jmp sdfm1dr4_isr||
nop||
nop||
nop||

#6 0
jmp spia_rx_isr||
nop||
nop||
nop||

#6 1
jmp spia_tx_isr||
nop||
nop||
nop||

#6 2
jmp spib_rx_isr||
nop||
nop||
nop||

#6 3
jmp spib_tx_isr||
nop||
nop||
nop||

#6 4
jmp lina_isr||
nop||
nop||
nop||

#6 5
jmp adce1_isr||
nop||
nop||
nop||

#6 6
jmp linb_isr||
nop||
nop||
nop||

#6 7
jmp adce2_isr||
nop||
nop||
nop||

#6 8
jmp spic_rx_isr||
nop||
nop||
nop||

#6 9
jmp spic_tx_isr||
nop||
nop||
nop||

#6 10
jmp spid_rx_isr||
nop||
nop||
nop||

#6 11
jmp spid_tx_isr||
nop||
nop||
nop||

#6 12
jmp sdfm2dr1_isr||
nop||
nop||
nop||

#6 13
jmp sdfm2dr2_isr||
nop||
nop||
nop||

#6 14
jmp sdfm2dr3_isr||
nop||
nop||
nop||

#6 15
jmp sdfm2dr4_isr||
nop||
nop||
nop||

#7 0
jmp dma_ch1_isr||
nop||
nop||
nop||

#7 1
jmp dma_ch2_isr||
nop||
nop||
nop||

#7 2
jmp dma_ch3_isr||
nop||
nop||
nop||

#7 3
jmp dma_ch4_isr||
nop||
nop||
nop||

#7 4
jmp dma_ch5_isr||
nop||
nop||
nop||

#7 5
jmp dma_ch6_isr||
nop||
nop||
nop||

#7 6
jmp eqep5_isr||
nop||
nop||
nop||

#7 7
jmp eqep6_isr||
nop||
nop||
nop||

#7 8
jmp fsirxc_int1_isr||
nop||
nop||
nop||

#7 9
jmp fsirxc_int2_isr||
nop||
nop||
nop||

#7 10
jmp fsirxd_int1_isr||
nop||
nop||
nop||

#7 11
jmp fsirxd_int2_isr||
nop||
nop||
nop||

#7 12
jmp sdfm3dr1_isr||
nop||
nop||
nop||

#7 13
jmp sdfm3dr2_isr||
nop||
nop||
nop||

#7 14
jmp sdfm3dr3_isr||
nop||
nop||
nop||

#7 15
jmp sdfm3dr4_isr||
nop||
nop||
nop||

#8 0
jmp i2ca_isr||
nop||
nop||
nop||

#8 1
jmp i2ca_fifo_isr||
nop||
nop||
nop||

#8 2
jmp i2cb_isr||
nop||
nop||
nop||

#8 3
jmp i2cb_fifo_isr||
nop||
nop||
nop||

#8 4
jmp uarta_isr||
nop||
nop||
nop||

#8 5
jmp uartb_isr||
nop||
nop||
nop||

#8 6
jmp epwm17_tz_isr||
nop||
nop||
nop||

#8 7
jmp epwm18_tz_isr||
nop||
nop||
nop||

#8 8
jmp adcg4_isr||
nop||
nop||
nop||

#8 9
jmp adcf4_isr||
nop||
nop||
nop||

#8 10
jmp sdfm3_isr||
nop||
nop||
nop||

#8 11
jmp sdfm4_isr||
nop||
nop||
nop||

#8 12
jmp clb5_isr||
nop||
nop||
nop||

#8 13
jmp clb6_isr||
nop||
nop||
nop||

#8 14
jmp adce3_isr||
nop||
nop||
nop||

#8 15
jmp adce4_isr||
nop||
nop||
nop||

#9 0
jmp scia_rx_isr||
nop||
nop||
nop||

#9 1
jmp scia_tx_isr||
nop||
nop||
nop||

#9 2
jmp scib_rx_isr||
nop||
nop||
nop||

#9 3
jmp scib_tx_isr||
nop||
nop||
nop||

#9 4
jmp cana_isr||
nop||
nop||
nop||

#9 5
jmp adcg_evt_isr||
nop||
nop||
nop||

#9 6
jmp epwm17_isr||
nop||
nop||
nop||

#9 7
jmp epwm18_isr||
nop||
nop||
nop||

#9 8
jmp mcana_isr||
nop||
nop||
nop||

#9 9
jmp adcg1_isr||
nop||
nop||
nop||

#9 10
jmp adcg2_isr||
nop||
nop||
nop||

#9 11
jmp adcg3_isr||
nop||
nop||
nop||

#9 12
jmp pmbus_isr||
nop||
nop||
nop||

#9 13
jmp aes_int_isr||
nop||
nop||
nop||

#9 14
jmp adce_evt_isr||
nop||
nop||
nop||

#9 15
jmp emif_isr||
nop||
nop||
nop||

#10 0
jmp adca_evt_isr||
nop||
nop||
nop||

#10 1
jmp adca2_isr||
nop||
nop||
nop||

#10 2
jmp adca3_isr||
nop||
nop||
nop||

#10 3
jmp adca4_isr||
nop||
nop||
nop||

#10 4
jmp adcb_evt_isr||
nop||
nop||
nop||

#10 5
jmp adcb2_isr||
nop||
nop||
nop||

#10 6
jmp adcb3_isr||
nop||
nop||
nop||

#10 7
jmp adcb4_isr||
nop||
nop||
nop||

#10 8
jmp adcc_evt_isr||
nop||
nop||
nop||

#10 9
jmp adcc2_isr||
nop||
nop||
nop||

#10 10
jmp adcc3_isr||
nop||
nop||
nop||

#10 11
jmp adcc4_isr||
nop||
nop||
nop||

#10 12
jmp adcd2_isr||
nop||
nop||
nop||

#10 13
jmp adcd3_isr||
nop||
nop||
nop||

#10 14
jmp adcd4_isr||
nop||
nop||
nop||

#10 15
jmp adccheck_isr||
nop||
nop||
nop||

#11 0
jmp cpu_cla_1_isr||
nop||
nop||
nop||

#11 1
jmp cpu_cla_2_isr||
nop||
nop||
nop||

#11 2
jmp cpu_cla_3_isr||
nop||
nop||
nop||

#11 3
jmp cpu_cla_4_isr||
nop||
nop||
nop||

#11 4
jmp cpu_cla_5_isr||
nop||
nop||
nop||

#11 5
jmp cpu_cla_6_isr||
nop||
nop||
nop||

#11 6
jmp cpu_cla_7_isr||
nop||
nop||
nop||

#11 7
jmp cpu_cla_8_isr||
nop||
nop||
nop||

#11 8
jmp mcanb_isr||
nop||
nop||
nop||

#11 9
jmp adcd_evt_isr||
nop||
nop||
nop||

#11 10
jmp adch3_isr||
nop||
nop||
nop||

#11 11
jmp adch4_isr||
nop||
nop||
nop||

#11 12
jmp sdfm4dr1_isr||
nop||
nop||
nop||

#11 13
jmp sdfm4dr2_isr||
nop||
nop||
nop||

#11 14
jmp sdfm4dr3_isr||
nop||
nop||
nop||

#11 15
jmp sdfm4dr4_isr||
nop||
nop||
nop||

#12 0
jmp xint3_isr||
nop||
nop||
nop||

#12 1
jmp xint4_isr||
nop||
nop||
nop||

#12 2
jmp xint5_isr||
nop||
nop||
nop||

#12 3
jmp clax_cipc0_isr||
nop||
nop||
nop||

#12 4
jmp clax_cipc1_isr||
nop||
nop||
nop||

#12 5
jmp clax_cipc2_isr||
nop||
nop||
nop||

#12 6
jmp clax_cipc3_isr||
nop||
nop||
nop||

#12 7
jmp core_lvf_isr||
nop||
nop||
nop||

#12 8
jmp core_luf_isr||
nop||
nop||
nop||

#12 9
jmp ecap6cal_isr||
nop||
nop||
nop||

#12 10
jmp ecap7cal_isr||
nop||
nop||
nop||

#12 11
jmp adch1_isr||
nop||
nop||
nop||

#12 12
jmp adch2_isr||
nop||
nop||
nop||

#12 13
jmp adcf_evt_isr||
nop||
nop||
nop||

#12 14
jmp adch_evt_isr||
nop||
nop||
nop||

#12 15
jmp adcf3_isr||
nop||
nop||
nop||

#13
jmp timer1_isr||
nop||
nop||
nop||

#14
jmp rt_thread_tick_intr||
nop||
nop||
nop||

#15
jmp nmi_isr||
nop||
nop||
nop||


_lb_func_init_bss:
# gr2 <= bss_start
movigh gr2 %hi16(__bss_start)||
movigl gr2 %lo16(__bss_start)||
# gr3 <= data_end
movigh gr3 %hi16(__data_end__)||
movigl gr3 %lo16(__data_end__)||
# gr4 <= constant 0
movigh gr4 0x0||
movigl gr4 0x0||
_lb_assign_0_loop:
eq gr2 gr3||
jc _lb_func_init_bss_end||
nop||
nop||
||store8 gr4 gr2 0
addi gr2 gr2 1||
jmp _lb_assign_0_loop||
nop||
nop||
_lb_func_init_bss_end:
ret||
nop||
nop||

_dsp_call_main:
# set .bss data section to all zero
call _lb_func_init_bss||
nop||
nop||
# set SP and call main()
movigh GR30 %hi16(_DSP_STACK_TOP)||
movigl GR30 %lo16(_DSP_STACK_TOP)||
call entry||
nop||
nop||

_main_exit_stay_nop:
jmp _main_exit_stay_nop||
nop||
nop||
nop||

_qx_default_isr:
jmp _qx_default_isr||
nop||
nop||
nop||

# declare default ISR for various interrupts
# they have weak linkage type and will be overwritten by corresponding external-linkage ISR defined in C
.weak exception_nc
.weak pic_group_nc
.weak rtos_isr
.weak trace_isr
.weak wp_isr
.weak adca1_isr
.weak adcb1_isr
.weak adcc1_isr
.weak xint1_isr
.weak xint2_isr
.weak timer0_isr
.weak wack_isr
.weak i2ca_high_isr
.weak sys_err_isr
.weak ecat_sync0_isr
.weak ecat_isr
.weak cipc0_isr
.weak cipc1_isr
.weak cipc2_isr
.weak cipc3_isr
.weak adca_hr1_isr
.weak adcb_hr1_isr
.weak adcc_hr1_isr
.weak epwm1_tz_isr
.weak epwm2_tz_isr
.weak epwm3_tz_isr
.weak epwm4_tz_isr
.weak epwm5_tz_isr
.weak epwm6_tz_isr
.weak epwm7_tz_isr
.weak epwm8_tz_isr
.weak epwm9_tz_isr
.weak epwm10_tz_isr
.weak epwm11_tz_isr
.weak epwm12_tz_isr
.weak epwm13_tz_isr
.weak epwm14_tz_isr
.weak epwm15_tz_isr
.weak epwm16_tz_isr
.weak epwm1_isr
.weak epwm2_isr
.weak epwm3_isr
.weak epwm4_isr
.weak epwm5_isr
.weak epwm6_isr
.weak epwm7_isr
.weak epwm8_isr
.weak epwm9_isr
.weak epwm10_isr
.weak epwm11_isr
.weak epwm12_isr
.weak epwm13_isr
.weak epwm14_isr
.weak epwm15_isr
.weak epwm16_isr
.weak ecap1_isr
.weak ecap2_isr
.weak ecap3_isr
.weak ecap4_isr
.weak ecap5_isr
.weak ecap6_isr
.weak ecap7_isr
.weak adcd1_isr
.weak fsitxa_int1_isr
.weak fsitxa_int2_isr
.weak fsitxb_int1_isr
.weak fsitxb_int2_isr
.weak fsirxa_int1_isr
.weak fsirxa_int2_isr
.weak fsirxb_int1_isr
.weak fsirxb_int2_isr
.weak ecap6_hrcal_isr
.weak ecap7_hrcal_isr
.weak eqep1_isr
.weak eqep2_isr
.weak eqep3_isr
.weak eqep4_isr
.weak clb1_isr
.weak clb2_isr
.weak clb3_isr
.weak clb4_isr
.weak sdfm1_isr
.weak sdfm2_isr
.weak sdfm1dr1_isr
.weak sdfm1dr2_isr
.weak sdfm1dr3_isr
.weak sdfm1dr4_isr
.weak spia_rx_isr
.weak spia_tx_isr
.weak spib_rx_isr
.weak spib_tx_isr
.weak spic_rx_isr
.weak spic_tx_isr
.weak spid_rx_isr
.weak spid_tx_isr
.weak sdfm2dr1_isr
.weak sdfm2dr2_isr
.weak sdfm2dr3_isr
.weak sdfm2dr4_isr
.weak dma_ch1_isr
.weak dma_ch2_isr
.weak dma_ch3_isr
.weak dma_ch4_isr
.weak dma_ch5_isr
.weak dma_ch6_isr
.weak eqep5_isr
.weak eqep6_isr
.weak fsirxc_int1_isr
.weak fsirxc_int2_isr
.weak fsirxd_int1_isr
.weak fsirxd_int2_isr
.weak sdfm3dr1_isr
.weak sdfm3dr2_isr
.weak sdfm3dr3_isr
.weak sdfm3dr4_isr
.weak dcc_isr
.weak i2ca_isr
.weak i2ca_fifo_isr
.weak i2cb_isr
.weak i2cb_fifo_isr
.weak uarta_isr
.weak uartb_isr
.weak epwm17_tz_isr
.weak epwm18_tz_isr
.weak lina_isr
.weak adce1_isr
.weak linb_isr
.weak adce2_isr
.weak pmbus_isr
.weak aes_int_isr
.weak adce_evt_isr
.weak emif_isr
.weak scia_tx_isr
.weak scia_rx_isr
.weak scib_tx_isr
.weak scib_rx_isr
.weak scic_tx_isr
.weak cana_isr
.weak canb_isr
.weak adcg_evt_isr
.weak epwm17_isr
.weak epwm18_isr
.weak mcana_isr
.weak adcg1_isr
.weak adcg2_isr
.weak adcg3_isr
.weak adcg4_isr
.weak adcf4_isr
.weak sdfm3_isr
.weak sdfm4_isr
.weak clb5_isr
.weak clb6_isr
.weak adce3_isr
.weak adce4_isr
.weak adch_evt_isr
.weak adcf3_isr
.weak adch1_isr
.weak adch2_isr
.weak adcf_evt_isr
.weak adch3_isr
.weak adch4_isr
.weak sdfm4dr1_isr
.weak sdfm4dr2_isr
.weak sdfm4dr3_isr
.weak sdfm4dr4_isr
.weak adca_evt_isr
.weak adca2_isr
.weak adca3_isr
.weak adca4_isr
.weak adcb_evt_isr
.weak adcb2_isr
.weak adcb3_isr
.weak adcb4_isr
.weak adcc_evt_isr
.weak adcc2_isr
.weak adcc3_isr
.weak adcc4_isr
.weak adcd2_isr
.weak adcd3_isr
.weak adcd4_isr
.weak adccheck_isr
.weak cpu_cla_1_isr
.weak cpu_cla_2_isr
.weak cpu_cla_3_isr
.weak cpu_cla_5_isr
.weak cpu_cla_6_isr
.weak cpu_cla_7_isr
.weak cpu_cla_8_isr
.weak mcanb_isr
.weak adcd_evt_isr
.weak adca_hs_isr
.weak adcb_hs_isr
.weak adcc_hs_isr
.weak ipc_0_isr
.weak ipc_1_isr
.weak ipc_2_isr
.weak ipc_3_isr
.weak ram_access_violation_isr
.weak luf_isr
.weak lvf_isr
.weak xint3_isr
.weak xint4_isr
.weak xint5_isr
.weak clax_cipc0_isr
.weak clax_cipc1_isr
.weak clax_cipc2_isr
.weak clax_cipc3_isr
.weak core_lvf_isr
.weak core_luf_isr
.weak ecap6cal_isr
.weak ecap7cal_isr
.weak xintf_isr
.weak adca_hr_evt_isr
.weak adca_hr2_isr
.weak adca_hr3_isr
.weak adca_hr4_isr
.weak adcb_hr_evt_isr
.weak adcb_hr2_isr
.weak adcb_hr3_isr
.weak adcb_hr4_isr
.weak adcc_hr_evt_isr
.weak adcc_hr2_isr
.weak adcc_hr3_isr
.weak adcc_hr4_isr
.weak timer1_isr
.weak timer2_isr
.weak nmi_isr
.weak _qx_default_isr

exception_nc      = _qx_default_isr
pic_group_nc      = _qx_default_isr
rtos_isr          = _qx_default_isr
trace_isr         = _qx_default_isr
wp_isr            = _qx_default_isr
adca1_isr         = _qx_default_isr
adcb1_isr         = _qx_default_isr
adcc1_isr         = _qx_default_isr
xint1_isr         = _qx_default_isr
xint2_isr         = _qx_default_isr
timer0_isr        = _qx_default_isr
wack_isr          = _qx_default_isr
i2ca_high_isr     = _qx_default_isr
sys_err_isr       = _qx_default_isr
ecat_sync0_isr    = _qx_default_isr
ecat_isr          = _qx_default_isr
cipc0_isr         = _qx_default_isr
cipc1_isr         = _qx_default_isr
cipc2_isr         = _qx_default_isr
cipc3_isr         = _qx_default_isr
adca_hr1_isr      = _qx_default_isr
adcb_hr1_isr      = _qx_default_isr
adcc_hr1_isr      = _qx_default_isr
epwm1_tz_isr      = _qx_default_isr
epwm2_tz_isr      = _qx_default_isr
epwm3_tz_isr      = _qx_default_isr
epwm4_tz_isr      = _qx_default_isr
epwm5_tz_isr      = _qx_default_isr
epwm6_tz_isr      = _qx_default_isr
epwm7_tz_isr      = _qx_default_isr
epwm8_tz_isr      = _qx_default_isr
epwm9_tz_isr      = _qx_default_isr
epwm10_tz_isr     = _qx_default_isr
epwm11_tz_isr     = _qx_default_isr
epwm12_tz_isr     = _qx_default_isr
epwm13_tz_isr     = _qx_default_isr
epwm14_tz_isr     = _qx_default_isr
epwm15_tz_isr     = _qx_default_isr
epwm16_tz_isr     = _qx_default_isr
epwm1_isr         = _qx_default_isr
epwm2_isr         = _qx_default_isr
epwm3_isr         = _qx_default_isr
epwm4_isr         = _qx_default_isr
epwm5_isr         = _qx_default_isr
epwm6_isr         = _qx_default_isr
epwm7_isr         = _qx_default_isr
epwm8_isr         = _qx_default_isr
epwm9_isr         = _qx_default_isr
epwm10_isr        = _qx_default_isr
epwm11_isr        = _qx_default_isr
epwm12_isr        = _qx_default_isr
epwm13_isr        = _qx_default_isr
epwm14_isr        = _qx_default_isr
epwm15_isr        = _qx_default_isr
epwm16_isr        = _qx_default_isr
ecap1_isr         = _qx_default_isr
ecap2_isr         = _qx_default_isr
ecap3_isr         = _qx_default_isr
ecap4_isr         = _qx_default_isr
ecap5_isr         = _qx_default_isr
ecap6_isr         = _qx_default_isr
ecap7_isr         = _qx_default_isr
adcd1_isr         = _qx_default_isr
fsitxa_int1_isr   = _qx_default_isr
fsitxa_int2_isr   = _qx_default_isr
fsitxb_int1_isr   = _qx_default_isr
fsitxb_int2_isr   = _qx_default_isr
fsirxa_int1_isr   = _qx_default_isr
fsirxa_int2_isr   = _qx_default_isr
fsirxb_int1_isr   = _qx_default_isr
fsirxb_int2_isr   = _qx_default_isr
ecap6_hrcal_isr   = _qx_default_isr
ecap7_hrcal_isr   = _qx_default_isr
eqep1_isr         = _qx_default_isr
eqep2_isr         = _qx_default_isr
eqep3_isr         = _qx_default_isr
eqep4_isr         = _qx_default_isr
clb1_isr          = _qx_default_isr
clb2_isr          = _qx_default_isr
clb3_isr          = _qx_default_isr
clb4_isr          = _qx_default_isr
sdfm1_isr         = _qx_default_isr
sdfm1dr1_isr      = _qx_default_isr
sdfm1dr2_isr      = _qx_default_isr
sdfm1dr3_isr      = _qx_default_isr
sdfm1dr4_isr      = _qx_default_isr
spia_rx_isr        = _qx_default_isr
spia_tx_isr        = _qx_default_isr
spib_rx_isr        = _qx_default_isr
spib_tx_isr        = _qx_default_isr
spic_rx_isr        = _qx_default_isr
spic_tx_isr        = _qx_default_isr
spid_rx_isr        = _qx_default_isr
spid_tx_isr        = _qx_default_isr
sdfm2dr1_isr       = _qx_default_isr
sdfm2dr2_isr       = _qx_default_isr
sdfm2dr3_isr       = _qx_default_isr
sdfm2dr4_isr       = _qx_default_isr
dma_ch1_isr       = _qx_default_isr
dma_ch2_isr       = _qx_default_isr
dma_ch3_isr       = _qx_default_isr
dma_ch4_isr       = _qx_default_isr
dma_ch5_isr       = _qx_default_isr
dma_ch6_isr       = _qx_default_isr
eqep5_isr         = _qx_default_isr
eqep6_isr         = _qx_default_isr
fsirxc_int1_isr    = _qx_default_isr
fsirxc_int2_isr    = _qx_default_isr
fsirxd_int1_isr    = _qx_default_isr
fsirxd_int2_isr    = _qx_default_isr
dcc_isr           = _qx_default_isr
i2ca_isr          = _qx_default_isr
i2ca_fifo_isr     = _qx_default_isr
i2cb_isr          = _qx_default_isr
i2cb_fifo_isr     = _qx_default_isr
uarta_isr         = _qx_default_isr
uartb_isr         = _qx_default_isr
epwm17_tz_isr     = _qx_default_isr
epwm18_tz_isr     = _qx_default_isr
lina_isr          = _qx_default_isr
adce1_isr         = _qx_default_isr
linb_isr          = _qx_default_isr
adce2_isr         = _qx_default_isr
scic_tx_isr       = _qx_default_isr
pmbus_isr         = _qx_default_isr
aes_int_isr       = _qx_default_isr
adce_evt_isr      = _qx_default_isr
scia_tx_isr       = _qx_default_isr
scia_rx_isr       = _qx_default_isr
scib_tx_isr       = _qx_default_isr
scib_rx_isr       = _qx_default_isr
cana_isr          = _qx_default_isr
canb_isr          = _qx_default_isr
adcg_evt_isr      = _qx_default_isr
epwm17_isr        = _qx_default_isr
epwm18_isr        = _qx_default_isr
mcana_isr         = _qx_default_isr
adcg1_isr         = _qx_default_isr
adcg2_isr         = _qx_default_isr
adcg3_isr         = _qx_default_isr
adcg4_isr         = _qx_default_isr
adcf4_isr         = _qx_default_isr
sdfm3_isr         = _qx_default_isr
sdfm4_isr         = _qx_default_isr
clb5_isr          = _qx_default_isr
clb6_isr          = _qx_default_isr
adce3_isr         = _qx_default_isr
adce4_isr         = _qx_default_isr
adch_evt_isr      = _qx_default_isr
adcf3_isr         = _qx_default_isr
adch1_isr         = _qx_default_isr
adch2_isr         = _qx_default_isr
adcf_evt_isr      = _qx_default_isr
adch3_isr         = _qx_default_isr
adch4_isr         = _qx_default_isr
adca_evt_isr      = _qx_default_isr
adca2_isr         = _qx_default_isr
adca3_isr         = _qx_default_isr
adca4_isr         = _qx_default_isr
adcb_evt_isr      = _qx_default_isr
adcb2_isr         = _qx_default_isr
adcb3_isr         = _qx_default_isr
adcb4_isr         = _qx_default_isr
adcc_evt_isr      = _qx_default_isr
adcc2_isr         = _qx_default_isr
adcc3_isr         = _qx_default_isr
adcc4_isr         = _qx_default_isr
adcd2_isr         = _qx_default_isr
adcd3_isr         = _qx_default_isr
adcd4_isr         = _qx_default_isr
adccheck_isr      = _qx_default_isr
cpu_cla_1_isr     = _qx_default_isr
cpu_cla_2_isr     = _qx_default_isr
cpu_cla_3_isr     = _qx_default_isr
cpu_cla_4_isr     = _qx_default_isr
cpu_cla_5_isr     = _qx_default_isr
cpu_cla_6_isr     = _qx_default_isr
cpu_cla_7_isr     = _qx_default_isr
cpu_cla_8_isr     = _qx_default_isr
mcanb_isr         = _qx_default_isr
adca_hs_isr       = _qx_default_isr
adcb_hs_isr       = _qx_default_isr
adcc_hs_isr       = _qx_default_isr
ipc_0_isr         = _qx_default_isr
ipc_1_isr         = _qx_default_isr
ipc_2_isr         = _qx_default_isr
ipc_3_isr         = _qx_default_isr
ram_access_violation_isr = _qx_default_isr
luf_isr           = _qx_default_isr
lvf_isr 		  = _qx_default_isr
xint3_isr         = _qx_default_isr
xint4_isr         = _qx_default_isr
xint5_isr         = _qx_default_isr
clax_cipc0_isr    = _qx_default_isr
clax_cipc1_isr    = _qx_default_isr
clax_cipc2_isr    = _qx_default_isr
clax_cipc3_isr    = _qx_default_isr
core_lvf_isr      = _qx_default_isr
core_luf_isr      = _qx_default_isr
ecap6cal_isr      = _qx_default_isr
ecap7cal_isr      = _qx_default_isr
xintf_isr         = _qx_default_isr
adca_hr_evt_isr   = _qx_default_isr
adca_hr2_isr      = _qx_default_isr
adca_hr3_isr      = _qx_default_isr
adca_hr4_isr      = _qx_default_isr
adcb_hr_evt_isr   = _qx_default_isr
adcb_hr2_isr      = _qx_default_isr
adcb_hr3_isr      = _qx_default_isr
adcb_hr4_isr      = _qx_default_isr
adcc_hr_evt_isr   = _qx_default_isr
adcc_hr2_isr      = _qx_default_isr
adcc_hr3_isr      = _qx_default_isr
adcc_hr4_isr      = _qx_default_isr
timer1_isr        = _qx_default_isr
timer2_isr        = _qx_default_isr
nmi_isr           = _qx_default_isr

.section .text
.global qx_precise_delay
# gr4 is the loop count from caller
qx_precise_delay:
addi gr4 gr4 0xffffffff||
nop||
nop||
lei gr4 0||
jnc qx_precise_delay||
nop||
nop||
ret||
nop||
nop||

.global fast_interrupt_initvectortable
# GR4: PIEVECTTABLE_BASE
# GR5: interrupt_defaulthandler
# GR2: address offset rellative to PIEVECTTABLE_BASE
# GR3: upper limit for GR2, 0x400
# GR0: PIEVECTTABLE_BASE
fast_interrupt_initvectortable:
movigh gr2 0x0||
movigl gr2 0x0||
movigh gr3 0x0||
movigl gr3 0x400||
fast_ivecinit_loop:
add gr6 gr4 gr2||
addi gr2 gr2 4||store32 gr5 gr6 0
eq gr2 gr3||
jnc fast_ivecinit_loop||
nop||
nop||
movg2g gr0 gr4||
ret||
nop||
nop||

# fake bootloader for debugging on RAM
.section .text.qxboot0debug
# enable NMI
movigh gr3 0x100||
movigl gr3 0x1200||
|load32 gr4 gr3 0|
bst gr4 0||
||store32 gr4 gr3 0
# set exp start for DSP cores and CLA
movigh gr2 0x0107||
movigl gr2 0x2000||
movigh gr4 0x0||
movigl gr4 %lo16(_core0_exp_start)||
||store32 gr4 gr2 0x34
movigl gr4 %lo16(_core0_cla_exp_start)||
||store32 gr4 gr2 0x35
# config SRAM banks
movigh gr2 0x0107||
movigl gr2 0x0000||
movigh gr3 0x0000||
movigl gr3 0x0000||
||store32 gr3 gr2 0x46
||store32 gr3 gr2 0x4a
||store32 gr3 gr2 0x48
||store32 gr3 gr2 0x49
# enable far ram prefetch
movigh gr2 0x0107||
movigl gr2 0x20DC||
moviglz gr3 1||
||store32 gr3 gr2 0
jmp _dsp_start||
nop||
nop||

.section .text.qxboot1debug
# set exp start for DSP cores and CLA
movigh gr2 0x0107||
movigl gr2 0x2000||
movigh gr4 0x0||
movigl gr4 %lo16(_core1_exp_start)||
||store32 gr4 gr2 0x34
movigl gr4 %lo16(_core1_cla_exp_start)||
||store32 gr4 gr2 0x35
# enable far ram prefetch
movigh gr2 0x0107||
movigl gr2 0x20DC||
moviglz gr3 1||
||store32 gr3 gr2 0
jmp _dsp_start||
nop||
nop||

